package org.hilo.boot.core.mapper;

import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.UpdateProvider;

import tk.mybatis.mapper.annotation.RegisterMapper;

/**
 * 通用Mapper接口,更新
 *
 * @author zollty
 */
@RegisterMapper
public interface UpdateByRecordMapper<T> {


    /**
     * 更新record中不为null的值，根据param实体中的属性值进行查询，查询条件使用等号
     * @see tk.mybatis.mapper.common.base.select.SelectMapper
     *
     * @param record 要更新的数据
     * @param param 匹配的条件
     */
    @UpdateProvider(type = UpdateByRecordProvider.class, method = "dynamicSQL")
    @Options(useCache = false, useGeneratedKeys = false)
    int updateByRecord(@Param("record") T record, @Param("param") T param);
    
}
